Skip to content

feat(stv): honor server startup audio hints - #30

Merged
mr-wanderer-x merged 5 commits into
mainfrom
fix/cancel-inflight-audio
Sep 29, 2026
Merged

mr-wanderer-x merged 5 commits into
mainfrom
fix/cancel-inflight-audio

Conversation

@mr-wanderer-x

@mr-wanderer-x mr-wanderer-x commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Avatar replies should not wait for a fixed 1,000 ms of audio when the server can start sooner. Both WebSocket and direct-WebRTC clients now apply the server's startup audio recommendation before replaying buffered TTS.

  • server_feed_initial_chunk_ms=None selects automatic tuning. Valid integer hints from 1–8,000 ms are accepted; missing or invalid hints retain the 1,000 ms fallback. Explicit application settings always win.
  • The documented Portrait profile uses 200 ms initial/subsequent thresholds and a 100 ms send gap. These are explicit settings, not global defaults. Larger TTS bursts remain whole unless fixed-size batching is explicitly enabled.
  • Startup hints and explicit settings use the same PCM16 sample rounding in fixed-size mode, including 44.1 kHz. Queued audio survives configuration and short tails flush without padding.

Merged current main (aa01226, Presence PR #29) into this branch. Presence's explicit profile, optional exact-size batching, socket-send timing, and cancellation-race fix are preserved. The cancellation implementation is already on main and is not a new change in this PR.

Version: 0.12.0 (main: 0.11.1).

Validation: all 286 hermetic unit tests pass, including Portrait and Presence profiles, invalid hints, pre-session audio replay, whole-burst preservation, fixed-size sample alignment, and cancellation during pacing/socket writes. Locked dependency installation, Ruff format/lint, example checks, comment policy, and wheel/sdist builds pass. Pyright reports two existing errors in interaction_messages.py, which is unchanged from main; the repository's type check is advisory. No live bot/model session or deployment was performed.

GitHub verify, examples, and build checks passed on cd8fc3d. Their only annotations are notices about the upcoming Ubuntu runner-image migration; no product-code finding was reported.

@mr-wanderer-x
mr-wanderer-x marked this pull request as ready for review September 28, 2026 12:55
mr-wanderer-x added a commit that referenced this pull request Sep 28, 2026
Human Presence clients can use smaller audio batches while retaining
complete TTS bursts, and traces distinguish queued audio from completed
socket writes. This PR contains the Presence SDK work for the
small-chunk deployment; the Portrait server-hint work is maintained
separately in #30 on `fix/cancel-inflight-audio`.

- The documented Presence profile explicitly sets a 320 ms initial
threshold, 200 ms subsequent minimum, 100 ms send gap, and
`server_feed_fixed_chunk_size=False`. A 1-second TTS burst is sent whole
once the threshold is met, subject to the existing transport cap.
- Optional exact-size batching preserves complete PCM16 samples and
flushes short tails without padding. It is disabled by default.
- Cancellation retires the unsent remainder of an old payload even when
cancellation completes during pacing or a socket write, preserving the
next reply.
- Tracing records `audio_queued` and completed `audio_sent`, including
duration, queue/pacing wait, and write time. A completed write is not a
server acknowledgement.

Both WebSocket playback and direct WebRTC use the shared feed. Global
defaults remain 1,000 ms initial, 400 ms subsequent, and 200 ms gap;
applications opt into the Presence profile. This branch does not consume
server startup hints. Version: `0.11.1`.

Validation: 255 hermetic tests passed, including both transports at 320
ms, whole-burst preservation, turn rearming, packet/sample boundaries,
short tails, and cancellation races. Ruff format/lint, example checks,
comment policy, locked dependency install, and wheel/sdist build passed.
Pyright reports the same two pre-existing `interaction_messages.py`
errors as `main`; CI type checking remains advisory. Live model sessions
were not run.

The Ojin checkout was left unchanged during this split. Local
verification and commits were performed directly because the
helper-agent limit was reached; each commit's parent and tree were
verified.

GitHub verify, examples, and build checks passed on the current head.
The only check annotations are GitHub's upcoming Ubuntu runner-image
migration notices; these are unrelated to the SDK changes.
@mr-wanderer-x
mr-wanderer-x marked this pull request as draft September 29, 2026 11:07
Keep Portrait's server-advised audio startup alongside Presence batching and cancellation fixes. Preserve whole PCM16 samples when startup recommendations change fixed packet thresholds.
@mr-wanderer-x mr-wanderer-x changed the title feat(stv): support Human Portrait startup hints and cancellation feat(stv): honor server startup audio hints Sep 29, 2026
@mr-wanderer-x
mr-wanderer-x marked this pull request as ready for review September 29, 2026 11:11
@mr-wanderer-x
mr-wanderer-x merged commit 599d319 into main Sep 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant